import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F


class TestNet(nn.Module):
    def __init__(self):
        super(TestNet, self).__init__()

    def forward(self,input_x):
        shape1 = input_x.size()[1:]
        test_net = nn.LayerNorm(shape1)
        out = test_net(input_x)
        return [out]


if __name__ == "__main__":
    net = TestNet()

    x = torch.FloatTensor(np.ones([20, 5, 10, 10]).astype(np.float32))

    result = net(x)
    print(result[0])
    print(result[0].mean())
    print(result[0].shape)


